/*
 * Copyright (C) 2015 yixun All Rights Reserved.
 * 
 * CaseMemberMapper.java
 */
package com.yixun.qfbao.xf.mapper;

import com.yixun.qfbao.xf.model.CaseMember;
import com.yixun.qfbao.xf.model.dto.CaseMemberDto;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;
/**
 * [文件名称]<br>
 * CaseMemberMapper.java<br>
 * <br>
 * [文件描述]<br>
 * 案场人员与驻守楼盘关系表 mapper<br>
 * <br>
 * [修改记录]<br>
 * 2015-11-10 14:57:23 创建 陶俊代码生成器<br>
 * 
 * @author 陶俊代码生成器
 * @version 1.00
 */
public interface CaseMemberMapper {
    
	/**
	 * 新增
	 * @param caseMember 新增BEAN信息
	 * @return 操作行数
	 */
	int add(CaseMember caseMember);
	/**
	 * 删除
	 * @param caseMemberDto 满足删除的条件
	 * @return 操作行数
	 */
    int del(CaseMemberDto caseMemberDto);
	/**
	 * 删除
	 * @param ids 待删除的唯一主键拼接的字符串,主键间以,隔开
	 * @return 操作行数
	 */
    int dels(String ids);
    /**
     * 编辑
     * @param caseMember 需要编辑的BEAN信息
     */
    int edit(CaseMember caseMember);
    /**
     * 编辑
     * @param caseMember 需要编辑的BEAN信息
     * @param ids 待编辑的唯一主键拼接的字符串,主键间以,隔开
     * @return 更新行数
     */
    int edits(@Param("caseMemberDto")CaseMember caseMember,@Param("ids")String ids);
    /**
     * 搜索总数
     * @param caseMemberDto 搜索条件
     * @return 符合条件记录总数
     */
	int count(CaseMemberDto caseMemberDto);
    /**
	 * 搜索 - 支持分页
	 * @param caseMemberDto blackWhiteList(搜索条件)
	 * @param beginNum 分页开始页不包含
	 * @param endNum 分页结束页不包含
	 * @return 分页数据
	 */
	List<CaseMember> list(@Param("caseMemberDto")CaseMemberDto caseMemberDto,@Param("beginNum")int beginNum,@Param("endNum")int endNum);
   
    /**
	 * 搜索 
	 * @param caseMemberDto blackWhiteList(搜索条件)
	 * @return 分页数据
	 */
	List<CaseMember> selectListByDto(@Param("caseMemberDto")CaseMemberDto caseMemberDto);
	
    /**
	 * 搜索 - 支持分页
	 * @param caseMemberDto blackWhiteList(搜索条件)
	 * @return 分页数据
	 */
	CaseMember selectByDto(@Param("caseMemberDto")CaseMemberDto caseMemberDto);
	
	/**
	 * @param id
	 * @return
	 * 根据id查询记录
	 */
	CaseMember selectById(@Param("id")Long id);
	
	/**
	 * @param premisesName 楼盘名称模糊查询
	 * @return CaseMember列表
	 */
	List<CaseMember> selectListByPremisesName(@Param("premisesName")String premisesName);
	
	/**
	 * 搜索 
	 * @param caseMemberDto blackWhiteList(搜索条件)
	 * @return 分页数据
	 */
	List<CaseMemberDto> selectParAndPreListByDto(@Param("caseMemberDto")CaseMemberDto caseMemberDto);

	/**
	 * 搜索 
	 * @param caseMemberDto blackWhiteList(搜索条件)
	 * @return 分页数据
	 */
	List<CaseMemberDto> selectCaseMemberInfoByPremisesIds(@Param("caseMemberDto")CaseMemberDto caseMemberDto);

	List<CaseMemberDto> selectCMListGroupByPremises(@Param("caseMemberDto")CaseMemberDto caseMemberDto);

	
    List<Map<String, Object>>  findCompanyList(@Param("premisesId") Long premisesId, @Param("premisesIds")List<Long> premisesIds);

    /**
	 * 搜索 
	 * @param caseMemberDto blackWhiteList(搜索条件)
	 * @return 分页数据
	 */
	List<CaseMemberDto> selectPremisesListByDto(@Param("caseMemberDto")CaseMemberDto caseMemberDto);
	
	/**
	 * 搜索 
	 * @param caseMemberDto blackWhiteList(搜索条件)
	 * @return 分页数据
	 */
	List<CaseMemberDto> getPremisesCMList(@Param("caseMemberDto")CaseMemberDto caseMemberDto);

	/**
	 * 驻场人员短信配置
	 * @param list
	 * @return
	 */
	List<CaseMemberDto> selectPremisesCMSmsList(@Param("list")List<Long> list,@Param("higherId")Long companyId);

	int editForPhoneStatus(CaseMember caseMember);

    List<CaseMemberDto> getDistincPremisesCMList(@Param("list")List<Long> list,@Param("higherId")Long companyId);

    List<CaseMemberDto> selectListForWxMsg(@Param("caseMemberDto") CaseMemberDto caseMemberDto);

    List<CaseMemberDto> selectList(@Param("caseMemberDto") CaseMemberDto caseMemberDto);
	/**
	 * 服用短信设置
	 * @param companyId
	 */
    void reuseSmsSetting(@Param("companyId") Long companyId);

    List<CaseMemberDto> selectListForDept(@Param("caseMemberDto") CaseMemberDto caseMemberDto);
    
    /**
	 * 	根据ID 批量修改对应的员工微信消息订阅
	 * @param caseMemberDtos
	 * @return
	 */
    int batchUpdateCaseMemberWxStatus(List<CaseMemberDto> caseMemberDtos);
    
    /**
     * 批量插入
     * @param caseMemberDto
     * @return
     */
    int batchInsert(CaseMemberDto caseMemberDto);

	/**
	 *  批量删除
	 * @param list
	 */
	void batchDeleted(List<CaseMemberDto> list);

	/**
	 *  批量添加楼盘驻场
	 * @param list
	 */
	void batchAdd(List<CaseMemberDto> list);
}
